#include<stdio.h>     
#include<time.h>

static unsigned long int next = 1;

void my_srand(unsigned int seed)
{
	next = seed;
}

int my_rand()
{
	next = next * 1103515245 + 12345;             //这里为什么要用这个公式。1103515245和12345 可以换成别的数吗
	return (unsigned int)(next / 65536) % 32768;
}

int main()
{
	int i, j = 10;
	my_srand(time(NULL));
	while (j--)
	{
		i = my_rand();
		printf("%d\n", i);
	}
	return 0;
}
